/*
 * Copyright (c) 2015, Potevio Information Technology Co., Ltd. 
 * All rights reserved.
 * POTEVIO PROPRIETARY/CONFIDENTIAL.
 */
package com.cpit.platform.common.entity;

import java.util.ArrayList;
import java.util.List;
/**
 * 表格查询的不分页结果封装。该结构为jqGrid使用。
 * @author zhanghaibin
 * @date 2016-01-05
 */
public class TableJsonDataNoPage {
	/** 总记录数  */
	private String records = "";
	/** 记录数据  */
	private List<TableRow> rows = new ArrayList<TableRow>();
	
	@SuppressWarnings("rawtypes")
	public TableJsonDataNoPage(List serviceData) {
		super();
		if (serviceData == null) {
			return;
		}
		int len = serviceData.size();
		this.records = String.valueOf(len);
		if (serviceData != null || len > 0) {
			for (int i = 0; i < len; i++) {
				TableRow tr = new TableRow(String.valueOf(i), serviceData.get(i));
				rows.add(tr);
			}
		}
	}

	public String getRecords() {
		return records;
	}

	public void setRecords(String records) {
		this.records = records;
	}

	public List<TableRow> getRows() {
		return rows;
	}

	public void setRows(List<TableRow> rows) {
		this.rows = rows;
	}

	@Override
	public String toString() {
		return "TableJsonData [records=" + records + ", rows=" + rows + "]";
	}
	
	
}
